from rest_framework.routers import SimpleRouter
from django.urls import path
from recruit.views import hotcity_view,visit_view,recruits_view,hotenter_view,detail_view,recruitsearch_view

urlpatterns = [
        # 热门城市
        path('city/hotlist/',hotcity_view.CityView.as_view()),
        # 增加企业访问次数
        path('enterprise/<int:id>/visit/',visit_view.VisitEnterpriseView.as_view()),
        # 推荐职位
        path('recruits/search/recommend/', recruits_view.RecommendView.as_view()),
        # 最新职位
        path('recruits/search/latest/',recruits_view.LatestRecruitView.as_view()),
        # 热门企业列表
        path('enterprise/search/hotlist/', hotenter_view.HotEnterpriseModelView.as_view()),
        # 增加职位访问次数
        path('recruits/<int:id>/visit/',visit_view.VisitRecruitView.as_view()),
        # 职位详情
        path('recruits/<int:id>/',detail_view.RecruitDetailView.as_view()),
        # 收藏职位
        # path('recruits/<int:id>/collect/',detail_view.ReCollectionView.as_view()),
        # 取消收藏职位
        path('recruits/<int:id>/cancelcollect/',detail_view.ReCancelCollectionView.as_view()),
        # 企业详情
        path('enterprise/<int:id>/',detail_view.EnterpriseDetailView.as_view()),
        # 收藏企业
        path('enterprise/<int:id>/collect/',detail_view.EnterCollectionView.as_view()),
        # 取消收藏企业
        path('enterprise/<int:id>/cancelcollect/',detail_view.EnterCancelCollectionView.as_view()),
        # 职位搜索
        path('recruits/search/city/keyword/',recruitsearch_view.ReSearchView.as_view()),

               ]

router = SimpleRouter()
router.register(prefix='recruits',viewset=detail_view.RecuitCollectionViewSet)
urlpatterns.extend(router.urls)